3.4.8 \(\int \frac {a+b \log (c (d+e x)^n)}{(f+\frac {g}{x})^3 x^3} \, dx\) [308]

Optimal. Leaf size=112 \[ -\frac {b e n}{2 f (d f-e g) (g+f x)}+\frac {b e^2 n \log (d+e x)}{2 f (d f-e g)^2}-\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (g+f x)^2}-\frac {b e^2 n \log (g+f x)}{2 f (d f-e g)^2} \]

[Out]

-1/2*b*e*n/f/(d*f-e*g)/(f*x+g)+1/2*b*e^2*n*ln(e*x+d)/f/(d*f-e*g)^2+1/2*(-a-b*ln(c*(e*x+d)^n))/f/(f*x+g)^2-1/2*
b*e^2*n*ln(f*x+g)/f/(d*f-e*g)^2

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2459, 2442, 46} \begin {gather*} -\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (f x+g)^2}+\frac {b e^2 n \log (d+e x)}{2 f (d f-e g)^2}-\frac {b e^2 n \log (f x+g)}{2 f (d f-e g)^2}-\frac {b e n}{2 f (f x+g) (d f-e g)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Log[c*(d + e*x)^n])/((f + g/x)^3*x^3),x]

[Out]

-1/2*(b*e*n)/(f*(d*f - e*g)*(g + f*x)) + (b*e^2*n*Log[d + e*x])/(2*f*(d*f - e*g)^2) - (a + b*Log[c*(d + e*x)^n
])/(2*f*(g + f*x)^2) - (b*e^2*n*Log[g + f*x])/(2*f*(d*f - e*g)^2)

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2459

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)/(x_))^(q_.)*(x_)^(m_.), x_Symbol]
 :> Int[(g + f*x)^q*(a + b*Log[c*(d + e*x)^n])^p, x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q}, x] && EqQ[m,
q] && IntegerQ[q]

Rubi steps

\begin {align*} \int \frac {a+b \log \left (c (d+e x)^n\right )}{\left (f+\frac {g}{x}\right )^3 x^3} \, dx &=\int \frac {a+b \log \left (c (d+e x)^n\right )}{(g+f x)^3} \, dx\\ &=-\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (g+f x)^2}+\frac {(b e n) \int \frac {1}{(d+e x) (g+f x)^2} \, dx}{2 f}\\ &=-\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (g+f x)^2}+\frac {(b e n) \int \left (\frac {e^2}{(d f-e g)^2 (d+e x)}+\frac {f}{(d f-e g) (g+f x)^2}-\frac {e f}{(d f-e g)^2 (g+f x)}\right ) \, dx}{2 f}\\ &=-\frac {b e n}{2 f (d f-e g) (g+f x)}+\frac {b e^2 n \log (d+e x)}{2 f (d f-e g)^2}-\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (g+f x)^2}-\frac {b e^2 n \log (g+f x)}{2 f (d f-e g)^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 83, normalized size = 0.74 \begin {gather*} -\frac {a+b \log \left (c (d+e x)^n\right )-\frac {b e n (g+f x) (-d f+e g+e (g+f x) \log (d+e x)-e (g+f x) \log (g+f x))}{(d f-e g)^2}}{2 f (g+f x)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Log[c*(d + e*x)^n])/((f + g/x)^3*x^3),x]

[Out]

-1/2*(a + b*Log[c*(d + e*x)^n] - (b*e*n*(g + f*x)*(-(d*f) + e*g + e*(g + f*x)*Log[d + e*x] - e*(g + f*x)*Log[g
 + f*x]))/(d*f - e*g)^2)/(f*(g + f*x)^2)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.31, size = 633, normalized size = 5.65

method result size
risch \(-\frac {b \ln \left (\left (e x +d \right )^{n}\right )}{2 f \left (f x +g \right )^{2}}-\frac {i \pi b \,d^{2} f^{2} \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}+i \pi b \,e^{2} g^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}+i \pi b \,e^{2} g^{2} \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}+i \pi b \,d^{2} f^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}+2 a \,e^{2} g^{2}+2 \ln \left (f x +g \right ) b \,e^{2} g^{2} n -2 \ln \left (-e x -d \right ) b \,e^{2} g^{2} n -2 b \,e^{2} g^{2} n +4 \ln \left (f x +g \right ) b \,e^{2} f g n x +2 b d e \,f^{2} n x +2 a \,d^{2} f^{2}-4 \ln \left (-e x -d \right ) b \,e^{2} f g n x -4 a d e f g +2 \ln \left (c \right ) b \,d^{2} f^{2}+2 \ln \left (c \right ) b \,e^{2} g^{2}+2 b d e f n g +2 \ln \left (f x +g \right ) b \,e^{2} f^{2} n \,x^{2}-2 \ln \left (-e x -d \right ) b \,e^{2} f^{2} n \,x^{2}-4 \ln \left (c \right ) b d e f g -i \pi b \,e^{2} g^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )-i \pi b \,d^{2} f^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )-2 b \,e^{2} f g n x +2 i \pi b d e f g \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}-i \pi b \,d^{2} f^{2} \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}-i \pi b \,e^{2} g^{2} \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}-2 i \pi b d e f g \,\mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}-2 i \pi b d e f g \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}+2 i \pi b d e f g \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{4 \left (f x +g \right )^{2} \left (d f -e g \right )^{2} f}\) \(633\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*ln(c*(e*x+d)^n))/(f+g/x)^3/x^3,x,method=_RETURNVERBOSE)

[Out]

-1/2*b/f/(f*x+g)^2*ln((e*x+d)^n)-1/4*(2*a*e^2*g^2+2*ln(f*x+g)*b*e^2*g^2*n-2*ln(-e*x-d)*b*e^2*g^2*n-2*b*e^2*g^2
*n+4*ln(f*x+g)*b*e^2*f*g*n*x+I*Pi*b*d^2*f^2*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2+I*Pi*b*e^2*g^2*csgn(I*c)*c
sgn(I*c*(e*x+d)^n)^2+2*b*d*e*f^2*n*x+2*a*d^2*f^2-4*ln(-e*x-d)*b*e^2*f*g*n*x-4*a*d*e*f*g+2*ln(c)*b*d^2*f^2+2*ln
(c)*b*e^2*g^2+2*b*d*e*f*n*g+2*ln(f*x+g)*b*e^2*f^2*n*x^2-2*ln(-e*x-d)*b*e^2*f^2*n*x^2+I*Pi*b*e^2*g^2*csgn(I*(e*
x+d)^n)*csgn(I*c*(e*x+d)^n)^2+I*Pi*b*d^2*f^2*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2-4*ln(c)*b*d*e*f*g-2*b*e^2*f*g*n*x
-2*I*Pi*b*d*e*f*g*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2-2*I*Pi*b*d*e*f*g*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2-I*P
i*b*d^2*f^2*csgn(I*c*(e*x+d)^n)^3+2*I*Pi*b*d*e*f*g*csgn(I*c*(e*x+d)^n)^3+2*I*Pi*b*d*e*f*g*csgn(I*c)*csgn(I*(e*
x+d)^n)*csgn(I*c*(e*x+d)^n)-I*Pi*b*e^2*g^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)-I*Pi*b*e^2*g^2*csgn
(I*c*(e*x+d)^n)^3-I*Pi*b*d^2*f^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n))/(f*x+g)^2/(d*f-e*g)^2/f

________________________________________________________________________________________

Maxima [A]
time = 0.31, size = 174, normalized size = 1.55 \begin {gather*} -\frac {1}{2} \, b n {\left (\frac {e \log \left (f x + g\right )}{d^{2} f^{3} - 2 \, d f^{2} g e + f g^{2} e^{2}} - \frac {e \log \left (x e + d\right )}{d^{2} f^{3} - 2 \, d f^{2} g e + f g^{2} e^{2}} + \frac {1}{d f^{2} g - f g^{2} e + {\left (d f^{3} - f^{2} g e\right )} x}\right )} e - \frac {b \log \left ({\left (x e + d\right )}^{n} c\right )}{2 \, {\left (f^{3} x^{2} + 2 \, f^{2} g x + f g^{2}\right )}} - \frac {a}{2 \, {\left (f^{3} x^{2} + 2 \, f^{2} g x + f g^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*(e*x+d)^n))/(f+g/x)^3/x^3,x, algorithm="maxima")

[Out]

-1/2*b*n*(e*log(f*x + g)/(d^2*f^3 - 2*d*f^2*g*e + f*g^2*e^2) - e*log(x*e + d)/(d^2*f^3 - 2*d*f^2*g*e + f*g^2*e
^2) + 1/(d*f^2*g - f*g^2*e + (d*f^3 - f^2*g*e)*x))*e - 1/2*b*log((x*e + d)^n*c)/(f^3*x^2 + 2*f^2*g*x + f*g^2)
- 1/2*a/(f^3*x^2 + 2*f^2*g*x + f*g^2)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 258 vs. \(2 (108) = 216\).
time = 0.36, size = 258, normalized size = 2.30 \begin {gather*} -\frac {a d^{2} f^{2} + {\left (b f^{2} n x^{2} + 2 \, b f g n x + b g^{2} n\right )} e^{2} \log \left (f x + g\right ) - {\left (b f g n x + b g^{2} n - a g^{2}\right )} e^{2} + {\left (b d f^{2} n x + b d f g n - 2 \, a d f g\right )} e + {\left (b d^{2} f^{2} n - 2 \, b d f g n e - {\left (b f^{2} n x^{2} + 2 \, b f g n x\right )} e^{2}\right )} \log \left (x e + d\right ) + {\left (b d^{2} f^{2} - 2 \, b d f g e + b g^{2} e^{2}\right )} \log \left (c\right )}{2 \, {\left (d^{2} f^{5} x^{2} + 2 \, d^{2} f^{4} g x + d^{2} f^{3} g^{2} + {\left (f^{3} g^{2} x^{2} + 2 \, f^{2} g^{3} x + f g^{4}\right )} e^{2} - 2 \, {\left (d f^{4} g x^{2} + 2 \, d f^{3} g^{2} x + d f^{2} g^{3}\right )} e\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*(e*x+d)^n))/(f+g/x)^3/x^3,x, algorithm="fricas")

[Out]

-1/2*(a*d^2*f^2 + (b*f^2*n*x^2 + 2*b*f*g*n*x + b*g^2*n)*e^2*log(f*x + g) - (b*f*g*n*x + b*g^2*n - a*g^2)*e^2 +
 (b*d*f^2*n*x + b*d*f*g*n - 2*a*d*f*g)*e + (b*d^2*f^2*n - 2*b*d*f*g*n*e - (b*f^2*n*x^2 + 2*b*f*g*n*x)*e^2)*log
(x*e + d) + (b*d^2*f^2 - 2*b*d*f*g*e + b*g^2*e^2)*log(c))/(d^2*f^5*x^2 + 2*d^2*f^4*g*x + d^2*f^3*g^2 + (f^3*g^
2*x^2 + 2*f^2*g^3*x + f*g^4)*e^2 - 2*(d*f^4*g*x^2 + 2*d*f^3*g^2*x + d*f^2*g^3)*e)

________________________________________________________________________________________

Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*ln(c*(e*x+d)**n))/(f+g/x)**3/x**3,x)

[Out]

Exception raised: NotImplementedError >> no valid subset found

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 302 vs. \(2 (108) = 216\).
time = 2.50, size = 302, normalized size = 2.70 \begin {gather*} -\frac {b f^{2} n x^{2} e^{2} \log \left (f x + g\right ) - b f^{2} n x^{2} e^{2} \log \left (x e + d\right ) + b d f^{2} n x e + 2 \, b f g n x e^{2} \log \left (f x + g\right ) + b d^{2} f^{2} n \log \left (x e + d\right ) - 2 \, b f g n x e^{2} \log \left (x e + d\right ) - 2 \, b d f g n e \log \left (x e + d\right ) - b f g n x e^{2} + b d f g n e + b g^{2} n e^{2} \log \left (f x + g\right ) + b d^{2} f^{2} \log \left (c\right ) - 2 \, b d f g e \log \left (c\right ) + a d^{2} f^{2} - b g^{2} n e^{2} - 2 \, a d f g e + b g^{2} e^{2} \log \left (c\right ) + a g^{2} e^{2}}{2 \, {\left (d^{2} f^{5} x^{2} - 2 \, d f^{4} g x^{2} e + 2 \, d^{2} f^{4} g x + f^{3} g^{2} x^{2} e^{2} - 4 \, d f^{3} g^{2} x e + d^{2} f^{3} g^{2} + 2 \, f^{2} g^{3} x e^{2} - 2 \, d f^{2} g^{3} e + f g^{4} e^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*(e*x+d)^n))/(f+g/x)^3/x^3,x, algorithm="giac")

[Out]

-1/2*(b*f^2*n*x^2*e^2*log(f*x + g) - b*f^2*n*x^2*e^2*log(x*e + d) + b*d*f^2*n*x*e + 2*b*f*g*n*x*e^2*log(f*x +
g) + b*d^2*f^2*n*log(x*e + d) - 2*b*f*g*n*x*e^2*log(x*e + d) - 2*b*d*f*g*n*e*log(x*e + d) - b*f*g*n*x*e^2 + b*
d*f*g*n*e + b*g^2*n*e^2*log(f*x + g) + b*d^2*f^2*log(c) - 2*b*d*f*g*e*log(c) + a*d^2*f^2 - b*g^2*n*e^2 - 2*a*d
*f*g*e + b*g^2*e^2*log(c) + a*g^2*e^2)/(d^2*f^5*x^2 - 2*d*f^4*g*x^2*e + 2*d^2*f^4*g*x + f^3*g^2*x^2*e^2 - 4*d*
f^3*g^2*x*e + d^2*f^3*g^2 + 2*f^2*g^3*x*e^2 - 2*d*f^2*g^3*e + f*g^4*e^2)

________________________________________________________________________________________

Mupad [B]
time = 0.67, size = 173, normalized size = 1.54 \begin {gather*} \frac {b\,e^2\,n\,\mathrm {atanh}\left (\frac {2\,d^2\,f^3-2\,e^2\,f\,g^2}{2\,f\,{\left (d\,f-e\,g\right )}^2}+\frac {2\,e\,f\,x}{d\,f-e\,g}\right )}{f\,{\left (d\,f-e\,g\right )}^2}-\frac {b\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )}{2\,f\,\left (f^2\,x^2+2\,f\,g\,x+g^2\right )}-\frac {\frac {a\,d\,f-a\,e\,g+b\,e\,g\,n}{d\,f-e\,g}+\frac {b\,e\,f\,n\,x}{d\,f-e\,g}}{2\,f^3\,x^2+4\,f^2\,g\,x+2\,f\,g^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*log(c*(d + e*x)^n))/(x^3*(f + g/x)^3),x)

[Out]

(b*e^2*n*atanh((2*d^2*f^3 - 2*e^2*f*g^2)/(2*f*(d*f - e*g)^2) + (2*e*f*x)/(d*f - e*g)))/(f*(d*f - e*g)^2) - (b*
log(c*(d + e*x)^n))/(2*f*(g^2 + f^2*x^2 + 2*f*g*x)) - ((a*d*f - a*e*g + b*e*g*n)/(d*f - e*g) + (b*e*f*n*x)/(d*
f - e*g))/(2*f*g^2 + 2*f^3*x^2 + 4*f^2*g*x)

________________________________________________________________________________________